#ifndef __APP_MQTT_H__
#define __APP_MQTT_H__

#include <unistd.h>

#define MQTT_SERVER "ws://192.168.23.10:1883"                 // 服务器地址
#define MQTT_CLIENT_ID "34bb7155-5184-4eb5-91ad-539356033b01" // 客户端ID
#define MQTT_PUSH_TOPIC "gateway/push"                        // 发布消息的topic
#define MQTT_PULL_TOPIC "gateway/pull"                        // 订阅消息的topic
#define MQTT_QOS 0                                            // QOS等级

/**
 * @brief 初始化
 *
 * @return int 0成功，-1失败
 */
int app_mqtt_init();

/**
 * @brief 通过MQTT客户端发布消息
 *
 * @return int
 */
int app_mqtt_publish(char *mqtt_message, size_t mqtt_message_len);

/**
 * @brief 释放资源
 *
 */
void app_mqtt_deinit();

#endif /* __APP_MQTT_H__ */